package khs.java_event.main.java;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * Hello world!
 *
 */
public class App
{
    public static void main( String[] args ) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
    {
        Method m = App.class.getMethod("handler", String.class);
        
        fire(m, "event fire!!!");
    }
    
    public static void fire(Method m, String arg0) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException{
        Object[] args = {new String(arg0)};
        m.invoke(null, args);
    }
    
    public static void handler(String arg0){
        System.out.println(arg0);
    }
}